package book;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: lenovo
 * Date: 2022-07-04
 * Time: 22:28
 */
public class Booklist {
    //书库
    Book[] books = new Book[10];
    //计数器
    private int usedsize;
    //书架最先 先放三本书

    public Booklist() {
        books[0]=new Book("三国演义","吴承恩","小说",19.0);
        books[1]=new Book("红楼梦","曹雪芹","小说",29.0);
        books[2] = new Book("水浒传","施耐庵","小说",19.0);
        usedsize = 3;
    }



    //拿到一本书
   public Book getBook(int pos){
        Book book = books[pos];
        return book;
    }
    //放入一本书
    public void setBook(int pos,Book book){
        books[pos] = book;
    }
//获取当前书籍数量
    public int getUsedsize() {
        return usedsize;
    }
//设置当前书籍数量
    public void setUsedsize(int usedsize) {
        this.usedsize = usedsize;
    }
}
